package com.eastfair.pay.chinaums.common.utils;

import cn.hutool.core.date.LocalDateTimeUtil;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

public class TimeUtil {

    public static String getTimestamp(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        return sdf.format(new Date());
    }

    public static String getTimestamp(LocalDateTime now) {
        return LocalDateTimeUtil.format(now,"yyyyMMddHHmmss");
    }
}
